define(function(require, exports, module) {
    "require:nomunge,exports:nomunge,module:nomunge";

    var app = require('mokit/app');
    var grid = require('mokit/grid');
    var commonUtils = require('../common/utils');
    var input = require('../common/input.js');
    var $ = require('mokit/jquery');

    /**
     * 登陆页视图
     */
    return app.view.create({
        template: module.resovleUri('../templates/nav.html'),

        el: {
            items: '.ui-nav-item'
        },

        /**
         * 在呈现时
         */
        onRender: function(context) {
            var self = this;
            grid.use(self.ui);
            self.el.items.each(function(i, item) {
                var itemElement = $(item);
                if (itemElement.attr('href').split('#')[1] == location.hash.split('#')[1]) {
                    itemElement.find('i').addClass('selected');
                    itemElement.find('label').addClass('selected');
                }
            });
        },

        utils: commonUtils

    });

});